package com.lonewalker.sparrow.exception;

import cn.hutool.http.HttpStatus;
import lombok.Getter;
import lombok.Setter;

/**
 * 服务异常
 *
 * @author lonewalker
 */
@Setter
@Getter
public class ServiceException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private final Integer code;

    public ServiceException(String message) {
        super(message);
        code = HttpStatus.HTTP_BAD_REQUEST;
    }

    public ServiceException(Integer code, String message) {
        super(message);
        this.code = code;
    }
}

